
#include "nr_server.h"

nr_server::nr_server(QObject *parent)
    : QObject(parent)
    , m_object_manager(nr_object_manager::instance())
    , m_net_server(parent, m_object_manager)
{
}

nr_server::~nr_server()
{
}

nr_error_t nr_server::start()
{
    nr_error_t status;
    status = m_object_manager.load();
    NR_ASSERT_RETURN(status);

    status = m_net_server.start();
    NR_ASSERT_RETURN(status);

    return status;
}

nr_error_t nr_server::stop()
{
    m_net_server.stop();
    m_object_manager.unload();
    
    return NR_ERROR_NONE;
}
